using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using MobileWebsiteGenerator.Entities;

namespace MobileWebsiteGenerator.Mapping
{
    public class PageMap : EntityTypeConfiguration<Page>
    {
        public PageMap()
        {
            // Primary Key
            this.HasKey(t => t.page_id);

            // Properties
            // Table & Column Mappings
            this.ToTable("Pages");
            this.Property(t => t.page_id).HasColumnName("page_id");
            this.Property(t => t.title).HasColumnName("title");
            this.Property(t => t.BackgroundImage).HasColumnName("BackgroundImage");
            this.Property(t => t.Priority).HasColumnName("Priority");
            this.Property(t => t.HTitle).HasColumnName("HTitle");
            this.Property(t => t.EContent).HasColumnName("EContent");
            this.Property(t => t.HContent).HasColumnName("HContent");
        }
    }
}

